﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceCS.DesignPattern.Core.AbstractFactoryPattern.KFC.Foods
{
    /// <summary>
    /// 食物基类
    /// </summary>
    public abstract class FoodBase : IFood
    {
        /// <summary>
        /// 名称
        /// </summary>
        protected abstract string Name { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        protected abstract decimal Price { get; set; }
        ///<inheritdoc/>
        public virtual string GetFoodInfo()
        {
            return $"name:{this.Name},price:{this.Price}";
        }
        public virtual decimal GetPrice()
        {
            return Price;
        }
        public override string ToString()
        {
            return GetFoodInfo();
        }
    }
}
